/**
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved. 
 */
package com.wilmar.process.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * 汇钱信息实体
 * 
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.0 Jun 22, 2010
 * @since 1.0.0
 * 
 */
public class CountersignInfo implements Serializable {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = -9190178934120320899L;

	private Set<User> users;
	private Map<User, String> deciditions;

	public boolean isAllSignalled() {
		boolean flag = false;
		if (this.users != null && !this.users.isEmpty()
				&& this.deciditions != null && !this.deciditions.isEmpty()) {
			for (User user : this.users) {
				String decidition = this.deciditions.get(user);
				if (decidition == null) {
					flag = false;
					break;
				}
			}
			flag = true;
		} else if (this.users == null || this.users.isEmpty()) {
			flag = true;
		}
		return flag;
	}

	public void appendDecidition(User user, String decidition) {
		if (this.deciditions == null)
			this.deciditions = new HashMap<User, String>();
		this.deciditions.put(user, decidition);
	}

	/**
	 * @return the users
	 */
	public Set<User> getUsers() {
		return users;
	}

	/**
	 * @param users
	 *            the users to set
	 */
	public void setUsers(Set<User> users) {
		this.users = users;
	}

	/**
	 * @return the deciditions
	 */
	public Map<User, String> getDeciditions() {
		return deciditions;
	}

	/**
	 * @param deciditions
	 *            the deciditions to set
	 */
	public void setDeciditions(Map<User, String> deciditions) {
		this.deciditions = deciditions;
	}

}
